#if !defined(INDEX_STRING_H)
#define INDEX_STRING_H
//888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
//
//	File		 :	index_string.h
//	Contents	 :	Header file for indexing strings
//	Creation Date:	18/02/2004
//	Last Modified:	18/02/2004	lg
//	tabs width	 :	every 4 characters
//
//888888888888888888888888888888888888888888888888888888888888888888888888888888888888888


#include <deque>
#include <string>
#include <boost/shared_ptr.hpp>


class t_index_string
{
private:

    class impl;
    boost::shared_ptr<impl> pimpl_;
public:
									t_index_string(unsigned default_size = 0);
                                    t_index_string(const t_index_string& other);
    t_index_string &                operator=(t_index_string const &);
	bool							is_indexed(const std::string& name, unsigned& index) const;
	bool							is_indexed(const std::string& name) const
									{unsigned ignore; return is_indexed(name, ignore);}
	unsigned						index(const std::string& name, bool& added);
	unsigned						index(const std::string& name);
    // unsafe because index no longer in synch
    //  need to rebuild from scratch
	//void 							swap_deque(std::deque<std::string>&	index_to_name);
	const std::deque<std::string>&	get_deque() const;
	unsigned						size() const;
	const std::string&				string_at(unsigned i) const	{return get_deque()[i];}
	const std::string&				operator[](unsigned i) const {return get_deque()[i];}
};





#endif	//INDEX_STRING_H

